package com.bw.module_mine.ui.login

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import com.bw.lib_common.base.BaseFragment
import com.bw.lib_common.base.BaseViewModel
import com.bw.module_mine.R
import com.bw.module_mine.databinding.FragmentAccountLoginBinding
import com.bw.module_mine.databinding.FragmentPhoneLoginBinding
import com.bw.module_mine.ui.login.viewmodel.LoginViewModel
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class AccountLoginFragment : BaseFragment<LoginViewModel,FragmentAccountLoginBinding>() {
//    private val mViewModel: LoginViewModel by viewModels() //不和activity公用同一个viewmodel
    private val mViewModel: LoginViewModel by activityViewModels() //和activity公用同一个viewmodel。实现通信
    override val mLayoutResId: Int
        get() = R.layout.fragment_account_login


    override fun initView() {
        super.initView()
        //设置当前正在显示的fragment
        mViewModel.setShowingFragmentTag(AccountLoginFragment::class.java.simpleName)
    }

}